<%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=utf-8" errorPage="/error.jsp" isELIgnored="false" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://www.opensymphony.com/oscache" prefix="cache" %>
<%@ taglib uri="http://atleap.blandware.com/taglib" prefix="atleap" %>
<html:xhtml />

<atleap:constants className="com.blandware.atleap.webapp.util.core.WebappConstants" var="HTML_TEXT_FIELD_MAX_LENGTH" />
<atleap:constants className="com.blandware.atleap.webapp.struts.ContentTilesRequestProcessor" var="PROCESSED_URL" />
<atleap:content identifier="information" ignore="true" />
<table border="0" class="modificationTable">
	<tr>
		<th colspan="2" style="text-align: center;">
			<atleap:message key="core.globalProperty.globalOperations.title" />
		</th>
	</tr>
	<tr>
		<td style="border-right-width: 0px; ">
        	<atleap:message key="core.globalProperty.globalOperations.flushCache" />
		</td>
		<td align="right" style="border-left-width: 0px; ">
			<form onsubmit="disableButtons(this, true);window.location.href='<atleap:rewriteUrl action="/core/cache/flushAll" transaction="true" ><atleap:param name="redirectUrl" value="${requestScope[pageScope.PROCESSED_URL]}" /></atleap:rewriteUrl>';return false;">
				<atleap:message key="core.commons.buttons.perform" var="performMsg" />
				<input type="submit" class="button" value="${performMsg}" />
			</form>
		</td>
	</tr>
    <tr>
		<td style="border-right-width: 0px; ">
        	<atleap:message key="core.globalProperty.globalOperations.reIndexAll" />
		</td>
		<td align="right" style="border-left-width: 0px; ">
			<form onsubmit="disableButtons(this, true);window.location.href='<atleap:rewriteUrl action="/core/search/reIndexAll" transaction="true" ><atleap:param name="redirectUrl" value="${requestScope[pageScope.PROCESSED_URL]}" /></atleap:rewriteUrl>';return false;">
				<atleap:message key="core.commons.buttons.perform" var="performMsg" />
				<input type="submit" class="button" value="${performMsg}" />
			</form>
		</td>
	</tr>
	<tr>
		<td style="border-right-width: 0px; ">
        	<atleap:message key="core.globalProperty.globalOperations.reloadResources" />
		</td>
		<td align="right" style="border-left-width: 0px; ">
			<form onsubmit="disableButtons(this, true);window.location.href='<atleap:rewriteUrl action="/core/applicationResource/reload" transaction="true" ><atleap:param name="redirectUrl" value="${requestScope[pageScope.PROCESSED_URL]}" /></atleap:rewriteUrl>';return false;">
				<atleap:message key="core.commons.buttons.perform" var="performMsg" />
				<input type="submit" class="button" value="${performMsg}" />
			</form>
		</td>
	</tr>
	<tr>
		<td style="border-right-width: 0px; ">
        	<atleap:message key="core.globalProperty.globalOperations.reloadProperties" />
		</td>
		<td align="right" style="border-left-width: 0px; ">
			<form onsubmit="disableButtons(this, true);window.location.href='<atleap:rewriteUrl action="/core/globalProperty/reload" transaction="true" ><atleap:param name="redirectUrl" value="${requestScope[pageScope.PROCESSED_URL]}" /></atleap:rewriteUrl>';return false;">
				<atleap:message key="core.commons.buttons.perform" var="performMsg" />
				<input type="submit" class="button" value="${performMsg}" />
			</form>
		</td>
	</tr>
	<tr>
		<td style="border-right-width: 0px; ">
        	<atleap:message key="core.globalProperty.globalOperations.reloadTilesConfig" />
		</td>
		<td align="right" style="border-left-width: 0px; ">
			<form onsubmit="disableButtons(this, true);window.location.href='<atleap:rewriteUrl action="/core/tilesConfig/reload" transaction="true" ><atleap:param name="redirectUrl" value="${requestScope[pageScope.PROCESSED_URL]}" /></atleap:rewriteUrl>';return false;">
				<atleap:message key="core.commons.buttons.perform" var="performMsg" />
				<input type="submit" class="button" value="${performMsg}" />
			</form>
		</td>
	</tr>
</table>
<br/>
<atleap:grid name="globalPropertyGrid">
	<atleap:messages />
	<atleap:form action="core/globalProperty/update" method="POST" validateOnSubmit="false">
		<bean:size collection="${globalPropertyForm.propertyMap}" id="propertyMapSize" />
		<table cellpadding="0" cellspacing="0" border="0" class="modificationTable">
			<tr>
				<th colspan="2" style="text-align: center;">
					<atleap:message key="core.globalProperty.globalProperties" />
				</th>
			</tr>
			<atleap:rowsIterator var="entry" collection="${globalPropertyForm.propertyMap}">
				<tr>
					<th>
						<atleap:message key="core.globalProperty.${entry.key}" var="propertyTitle" />
						<c:if test="${empty propertyTitle}">
							<c:set var="propertyTitle" value="${entry.key}" />
						</c:if>
						<c:out value="${propertyTitle}" escapeXml="true" />
					</th>
					<td>
                    	<html:text styleClass="text" property="property(${entry.key})" maxlength="${pageScope.HTML_TEXT_FIELD_MAX_LENGTH}" />
	                    <html:hidden property="version(${entry.key})" />
					</td>
				</tr>
			</atleap:rowsIterator>
			<atleap:noRows>
				<tr>
					<td colspan="2">
						<em><atleap:message key="core.commons.nothingToShow"/></em>
					</td>
				</tr>
			</atleap:noRows>
		</table>
		<c:if test="${propertyMapSize> 0}">
			<div>
				<atleap:submit styleClass="button"><atleap:message key="core.commons.buttons.update" /></atleap:submit>
			</div>
		</c:if>
	</atleap:form>
</atleap:grid>


